﻿@model dynamic
@{
    Layout = "";
    String tipoDato;
}
<div align="right">
    <a class="button" href="javascript:exportar(3)" title="EXCEL">
        <img src="/images/xls.png" height="14px" width="12px" alt="" />Exportar</a>
</div>
<table class="choices" cellspacing="0">
    <thead>
        <tr>
        @foreach (String titulo in ViewBag.titulos)
        {
            <th>
                @titulo
            </th>
        }
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            dynamic colDyn = new System.Dynamic.ExpandoObject();
            var col = colDyn as IDictionary<String, object>;
            col = item;
            <tr>            
            @foreach (String columna in ViewBag.columnas)
            {
                tipoDato = @col[columna].GetType().ToString(); 

                <td>
                @if ("System.String".Equals(tipoDato))
                {
                    @col[columna]
                }
                else { 
                    @String.Format("{0:0.00%}", col[columna])
                }
                </td>
            }
           </tr>
        }
    </tbody>
</table>
